package com.foreknow.view;

import com.foreknow.bean.Person;
import com.foreknow.service.PersonService;
import com.foreknow.service.impl.PersonServiceImpl;

import java.util.Scanner;

public class ViewMain {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.println("please input name: ");
        String name = input.next();
        System.out.println("please input pass: ");
        String pass = input.next();
        //调用Service登录的方法
        PersonService service = new PersonServiceImpl();
        Person person =  service.isValidata(name,pass);
        if(person!=null) {
            System.out.println("name is:"+person.getName());
        }else {
            System.out.println("no data......");
        }
    }
}
